home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 March / MINDWARE_MAR_2001.iso / Software / developers / Readers / buildzone zapper / Zapper.exe / GLENGINE.DLL / HTML / ZAPPER.DTD
Encoding:
Text File  |  2000-10-15  |  5.3 KB  |  130 lines

  1. <!-- Pack DTD
  2.  !
  3.  !  A zap pack ('pack') is an XML document, that should conform to this DTD (it is an
  4.  !  instance of this DTD).  This should be specified in the pack by its using
  5.  !  the following two header lines:
  6.  !
  7.  !        <?xml version="1.0" encoding="utf-8">
  8.  !        <!DOCTYPE pack SYSTEM "zapper.dtd">
  9.  !
  10.  !  The main element of the pack is of type <pack>.
  11.  !  Comments are allowed in packs, using the standard syntax for XML comments.
  12.  !
  13.  !  It is customary to place a comment at the beginning of the pack to list
  14.  !  the pack author, copyright, &c.
  15. -->
  16.  
  17. <!ELEMENT pack (desc,external?,hier,zaplet+)>
  18.  
  19. <!-- Pack attributes: version, title, url
  20.  !
  21.  !  The version describes the DTD version; it is currently (27-3-2000) at version 3.0.
  22.  !
  23.  !  A pack must have a title, which is used to identify it in the packs list.
  24.  !  It is also displayed on the opened Zapper.
  25.  !  The pack title is a mandatory attribute of the pack element.
  26.  !
  27.  !  A pack may also specify a URL.  This URL should point to a location (probably
  28.  !  the canonical location) from which this pack can be downloaded.  If no URL is
  29.  !  specified, the pack is never refreshed.
  30. -->
  31. <!ATTLIST pack
  32.   version CDATA #REQUIRED
  33.   title CDATA #REQUIRED
  34.   url CDATA #REQUIRED>
  35.  
  36. <!-- Pack identity
  37.  !
  38.  !  The initial section of the pack contains global information for this pack.
  39.  !
  40.  !  The global information contains:
  41.  !  * The <desc> element contains a description of this pack.
  42.  !
  43.  !  It may be worthwhile to introduce a <common> tag here, which will contain functions
  44.  !  to be used by all of the zaplets in this pack (`global' definitions).  However,
  45.  !  this requires careful thought about language issues, such as the interaction with
  46.  !  zaplets in other languages than JavaScript (see below in the commentary for the
  47.  !  <script> tag).
  48. -->
  49. <!ELEMENT desc (#PCDATA)>
  50. <!ELEMENT external (#PCDATA)>    <!--internal-->
  51.  
  52. <!-- Zapper hierarchy
  53.  !
  54.  !  The second section of the pack is the zapper hierarchy to use for it.
  55.  !  The hierarchy references zaplets by their url; all of the zaplets referred to
  56.  !  must also be included in the pack (in its third section).  Also, the label to use
  57.  !  for each zaplet should be specified in the hierarchy (it will default to the
  58.  !  zaplet title).
  59. -->
  60. <!ELEMENT hier (folder|glref)+>
  61. <!ATTLIST glref
  62.  url CDATA #REQUIRED
  63.  label CDATA #IMPLIED
  64.  tip CDATA #IMPLIED>
  65. <!ELEMENT folder (folder|glref)*>
  66. <!ATTLIST folder
  67.  label CDATA #REQUIRED
  68.  tip CDATA #IMPLIED>
  69.  
  70. <!-- Zaplets
  71.  !
  72.  !  Following the identification part of the pack are the actual zaplets.
  73.  !  A pack should contain _at_least_ one zaplet.
  74.  !
  75.  !  A zaplet has the following attributes:
  76.  !  * url - a globally unique ID for this zaplet; this is composed of the original parent
  77.  !          pack's URL, concatenated with a sharp sign ('#') and a unique identifier
  78.  !          inside this pack (which may be any valid XML ID).  The initial ID for a
  79.  !          zaplet is created from its title.
  80.  !          (The initial part of the URL, up to the '#' sign, may be omitted if it is
  81.  !          equal to the pack's URL).
  82.  !  * title - title for this zaplet; this is also used as the default label.
  83.  !  * type - zaplet type; this should be "normal" for a zaplet that uses only
  84.  !           the user's selection, "bookmark" for a zaplet that doesn't require
  85.  !           a selection, or "extended" for a zaplet that uses the context.
  86.  !
  87.  !  The contents of a zaplet is a script (mandatory) and a description (optional).
  88.  !  If a description is specified, it is a simple text item; it is displayed in the
  89.  !  description part of the zapper.  A substring of the description enclosed in a
  90.  !  '%['..'%]' pair will be replaced with the contents of the edit box on display.
  91.  !  Scripts are described in more detail later on.
  92. -->
  93. <!ELEMENT zaplet (script,desc?,external?)>
  94. <!ATTLIST zaplet
  95.   url CDATA #IMPLIED
  96.   title CDATA #REQUIRED
  97.   type (normal|bookmark|extended) "normal">
  98.  
  99. <!-- Zaplet scripts
  100.  !
  101.  !  A zaplet must have some some executable contents; this content is what actually
  102.  !  gets executed when the user selects the zaplet.  This will generally be some
  103.  !  `function' of the text and context, and return an HTML result to the browser (or
  104.  !  an HTTP request, which should be performed to get this result).
  105.  !  Since the scripts may contain characters that are considered as markup by XML,
  106.  !  they should be encolsed in a CDATA element (like
  107.  !
  108.  !  <script lang="javascript"><![CDATA[
  109.  !   ...
  110.  !  ]]></script>
  111.  !
  112.  !  The only script language currently supported is JavaScript.
  113.  !  * lang="javascript" - the script is a JavaScript function (usually called "zaplet"),
  114.  !    which is invoked with two parameters: the text and the context.  A function name
  115.  !    name different than "zaplet" may be specified by using a comment line of the form
  116.  !
  117.  !       //@* function: NAME
  118.  !
  119.  !    as the first line of the script.
  120.  !
  121.  !  Other script languages (like Perl) may be added in the future.  Also, supporting
  122.  !  more `full-featured' languages (Java) may be a good idea; however, to do this will
  123.  !  require some mechanism for packaging the class files with the pack.
  124.  !  Another problem is the interaction of multiple-language support with the suggested
  125.  !  <common> block.
  126. -->
  127. <!ELEMENT script (#PCDATA)>
  128. <!ATTLIST script
  129.   lang (javascript) #REQUIRED>
  130.